<template>
	<view class="success">
		<view class="success-box">
			<view class="success-image">
				<image src="/static/icon-success.png" mode=""></image>
				<view class="success-text">{{title}}</view>
			</view>
			<u-row gutter="32" justify="center">
				<u-col span="6" v-if="title === '延期申请已提交'">
					<view><u-button type="primary" @click="navTo('/pages/work/work-handle')">查看工单</u-button></view>
				</u-col>
				<u-col span="5" v-if="title === '报修已提交'">
					<view><u-button @click="navTo('/pages/sys/home/index')">返回首页</u-button></view>
				</u-col>
				<u-col span="5" v-if="title === '报修已提交'">
					<view><u-button type="primary" @click="navTo('pages/work/index')">继续报修</u-button></view>
				</u-col>
			</u-row>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: ''
			};
		},
		onLoad: function (option) { //option为object类型，会序列化上个页面传递的参数
			this.title = option.title
		},
		methods: {
			navTo(href) {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.success {
		width: 100%;
		height: calc(100vh - var(--window-top) - var(--window-bottom));
		background: #fff;
		.success-box {
			width: 100%;
			position: fixed;
			top: 30%;
			left: 50%;
			transform: translate(-50%, -50%);
			.success-image {
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				image {
					width: 128rpx;
					height: 128rpx;
					margin-bottom: 40rpx;
				}
				.success-text {
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 34rpx;
					color: #333333;
					line-height: 52rpx;
					text-align: center;
					font-style: normal;
					margin-bottom: 64rpx	;
				}
			}
		}
	}
</style>
